﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class EnemyPlantBullet : MonoBehaviour {
    
    [Header("向左速度")]
    public float Lspeed;
    
    private void OnTriggerEnter2D(Collider2D other)
    {
        
        if (other.gameObject.tag == "Player")
        {
            Lspeed = 0;
            Destroy(gameObject);
            PlayerBloodController.con.SetBlood();
            PlayerController.con.PlayerHurt();
        }
    }
    // Use this for initialization
    void Start () {
        Invoke("SelfDestroy", 3f);
    }
	
	// Update is called once per frame
	void Update () {
            transform.position += new Vector3(-Lspeed * Time.deltaTime,0, 0);
    }
    public void SelfDestroy()
    {
        Destroy(gameObject);
    }
}
